<template>
  <div class="search-box">
    <search-component :itemList="searchList" :formData="searchData">
    </search-component>
  </div>
</template>

<script>
import SearchComponent from "@/components/search.vue";
export default {
  name: "Test",
  components: {
    SearchComponent,
  },
  data() {
    return {
      searchList: [
        {
          label: "项目名称：",
          prop: "name",
          type: "input",
          change: this.getEvent,
        },
        {
          label: "项目经理",
          prop: "person",
          type: "input",
        },
        {
          label: "状态",
          prop: "status",
          type: "select",
          options: [
            { label: "已完结", value: "1" },
            { label: "进行中", value: "2" },
          ],
        },
        {
          label: "时间：",
          prop: "date",
          type: "daterange",
          valueFormat: "yyyy-MM-dd",
        },
        {
          type: "button",
          btnList: [
            {
              type: "primary",
              label: "查询",
              size: "mini",
              icon: "el-icon-search",
              handle: (row) => this.search(),
            },
            {
              type: "info",
              label: "重置",
              size: "mini",
              icon: "el-icon-setting",
              handle: (row) => this.reset(),
            },
          ],
        },
      ],
      searchData: {
        name: "", //可以赋予初始值
        adress: "",
        date: "",
      },
    };
  },
  methods: {
    getEvent() {},
    search() {},
    reset() {
      this.searchData.name = "";
      this.searchData.adress = "";
      this.searchData.date = "";
    },
    resetForm() {
      this.ruleForm.testData = this.$refs.son.name;
    },
    getSonData() {},
  },
};
</script>

<style>
.search-box {
  margin-top: 500px;
}
</style>
